﻿@inherits BaseComponent

<LoginInfoForm @ref="form" Name="form1" Class="@FormStyle" Model="Model" Method="HttpMethod.Post" OnFinish="OnFinish">
    @if (OnSendSMS != null)
    {
        <FormItem Label="" Required Rules="@Context.RuleRequired("PhoneNo")">
            <AntInput Icon="phone" @bind-Value="@Model.PhoneNo" Placeholder="@Language["PhoneNo"]" />
        </FormItem>
        <FormItem Label="" Required Rules="@Context.RuleRequired("PhoneCode")">
            <AntCaptcha Icon="lock" @bind-Value="@Model.PhoneCode" Placeholder="@Language["PhoneCode"]" Option="option" />
        </FormItem>
        <FormItem Label="" Required Rules="@Context.RuleRequired("Captcha")">
            <AntCaptcha Icon="check" @ref="captcha" @bind-Value="@Model.Captcha" Placeholder="@Language["Captcha"]" />
        </FormItem>
        <FormItem>
            <Checkbox @bind-Value="Model.Remember">@Language["RememberPhone"]</Checkbox>
        </FormItem>
    }
    else
    {
        <FormItem Label="" Required Rules="@Context.RuleRequired("UserName")">
            <AntInput Icon="user" @bind-Value="@Model.UserName" Placeholder="@Language["UserName"]" />
        </FormItem>
        <FormItem Label="" Required Rules="@Context.RuleRequired("Password")">
            <AntPassword Icon="lock" @bind-Value="@Model.Password" Placeholder="@Language["Password"]" />
        </FormItem>
        @if (Stations != null && Stations.Count > 0)
        {
            <FormItem Label="" Required Rules="@Context.RuleRequired("Station")">
                <AntSelect Icon="control" @bind-Value="@Model.Station" DataSource="Stations" Placeholder="@Language["Station"]" />
            </FormItem>
        }
        else if (IsCaptcha)
        {
            <FormItem Label="" Required Rules="@Context.RuleRequired("Captcha")">
                <AntCaptcha Icon="check" @ref="captcha" @bind-Value="@Model.Captcha" Placeholder="@Language["Captcha"]" />
            </FormItem>
        }
        <FormItem>
            <Checkbox @bind-Value="Model.Remember">@Language["RememberUser"]</Checkbox>
        </FormItem>
    }
    <FormItem>
        <Button HtmlType="submit" Type="@ButtonType.Primary" Block>@Language["Login"]</Button>
    </FormItem>
</LoginInfoForm>